import axios from '@/utils/request';

const baseUserURL = process.env.VUE_APP_BASE_ORIGIN + '/iot_maintenance'; //维保中心

// 维保中心接口-获取保养通知列表


const getPlanList = data => {
  return axios.get(baseUserURL + '/maintenance/getMaintainNoticeList', { params: data });
};

// 创建工单
const createOrder = data => {
  return axios.post(baseUserURL + '/maintenance/createOrder', data);
};


// 获取保养详情
const getPlanDetail = params => {
  return axios.request({
    method: 'get',
    url: baseUserURL + '/maintenance/getMaintainNoticeDetail',
    params,
    headers: {
      hideLoading: true //是否显示loading
    }
  });
};
//获取工单联系人
const getDeviceLastContact = data => {
  return axios.get(baseUserURL + '/maintenance/getDeviceLastContact', {
    params: data
  });
};
//获取设备最新的项目编号
const getDeviceLastProject = data => {
  return axios.get(baseUserURL + '/maintenance/getDeviceLastProject', {
    params: data
  });
};
//保养通知转工单
const transferMaintainOrder = data => {
  return axios.put(baseUserURL + '/maintenance/transferMaintainOrder', data);
};
export { getPlanList, getPlanDetail, getDeviceLastProject, getDeviceLastContact, createOrder,transferMaintainOrder };
